Combining Proofs and Programs in a Dependently Typed Language ( With technical appendix )
نویسندگان
چکیده
Most dependently-typed p rogramming languages either require that all expressions terminate (e.g. Coq, Agda, and Epigram), or allow infinite loops but are inconsistent when viewed as logics (e.g. Haskell, ATS, Ωmega). Here, we combine these two approaches into a single dependently-typed core language. The language is composed of two fragments t hat share a common syntax and overlapping semantics: a logic that guarantees total correctness, and a call-by-value programming language that guarantees type safety but not termination. The two fragments may interact: logical expressions may b e used as programs; the logic may soundly r eason about potentially nonterminating p rograms; programs can require logical proofs as arguments; and “mobile” program values, including p roofs computed at runtime, may be used as evidence b y the logic. This language allows programmers to work with total and partial functions uniformly, p roviding a smooth path from functional programming t o dependently-typed programming. Categories and Subject D escriptors D.3. 1 [Programming L anguages]: Formal Definitions and T heory
منابع مشابه
Lightweight Verification with Dependent Types
Dependent types, studied for many years in Logic, have recently been gaining attention in Functional Programming Languages for expressing rich properties as types. A simple example is a type 〈list A n〉, for lists of length n holding objects of type A. A more complex example is 〈trm G T 〉, for terms in some object language which have object-language type T in context G. Dependently typed program...
متن کاملSupporting Dependently Typed Functional Programming with Testing and User-Assisted Proof Automation
Developing dependently typed functional programs can be difficult because the user may be required to write proofs and program errors are often hard to identify and fix. We describe a framework, implemented in Coq, that combines testing with user-assisted proof automation to make development easier. Testing occurs within Coq and is used to give user feedback to program errors and faulty conject...
متن کاملEmbedding a Language with Certified Size Constraints in a Dependently Typed Metalanguage
This paper studies the problem of constructing formal bounds on program resource usage and other complex properties. We use fullspectrum dependent types to embed a language of terms, RAFL, with resource usage properties and associated correctness proofs. Since these properties and associated proofs are directly expressed inRAFL through a formal logic, it follows that correctly specified resourc...
متن کاملType - Preserving CPS Translation of Σ and Π Types is Not Not Possible 22 : 3
Dependently typed languages such as Coq are used to specify and prove functional correctness of source programs, but what we ultimately need are guarantees about correctness of compiled code. By preserving dependent types through each compiler pass, we could preserve source-level specifications and correctness proofs into the generated target-language programs. Unfortunately, type-preserving co...
متن کاملType - Preserving CPS Translation of Σ and Π Types is Not Not
Dependently typed languages like Coq are used to specify and prove functional correctness of source programs, but what we ultimately need are guarantees about correctness of compiled code. By preserving dependent types through each compiler pass, we could preserve source-level specifications and correctness proofs into the generated target-language programs. Unfortunately, type-preserving compi...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2013